package com.onesports.intelligent.k12.polarlight.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import com.onesports.framework.kit.common.util.ParamUtils;

/**
 * 消息类型
 * @author wangcx
 **/
public enum BannerTypeEnum implements IEnum<String> {
    /**
     * 轮播图类型
     */
    BANNER_TYPE("1","轮播图"),
    SERVICE_TYPE("2","客服图");



    private final String type;
    private final String desc;


    BannerTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    @Override
    public String getValue() {
        return this.type;
    }

    @JsonValue
    public String getDesc() {
        return this.desc;
    }

    public BannerTypeEnum of() {
        return this;
    }

    public static BannerTypeEnum of(String desc) {
        for (BannerTypeEnum opt : BannerTypeEnum.values()) {
            if (ParamUtils.equals(opt.desc, desc)) {
                return opt;
            }
        }
        return null;
    }
}
